#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/2/27 14:04
# @Author  : harry
import django_filters

from dvadmin_wechat.models import FanManagement, FanTags, FanGroups


class FanManagementFilterSet(django_filters.rest_framework.FilterSet):
    create_datetime = django_filters.BaseRangeFilter(field_name='create_datetime')
    subscribe_time = django_filters.BaseRangeFilter(field_name='subscribe_time')
    update_datetime = django_filters.BaseRangeFilter(field_name='update_datetime')
    name = django_filters.CharFilter(field_name='name')
    open_id = django_filters.CharFilter(field_name='open_id')
    union_id = django_filters.CharFilter(field_name='union_id')
    subscribe = django_filters.CharFilter(field_name='subscribe')
    language = django_filters.CharFilter(field_name='language')
    remark = django_filters.CharFilter(field_name='remark')
    is_black = django_filters.CharFilter(field_name='is_black')
    subscribe_scene = django_filters.CharFilter(field_name='subscribe_scene')
    official_account_management_id = django_filters.CharFilter(field_name='official_account_management_id')

    class Meta:
        model = FanManagement
        fields = "__all__"


class FanTagsFilterSet(django_filters.rest_framework.FilterSet):
    create_datetime = django_filters.BaseRangeFilter(field_name='create_datetime')
    update_datetime = django_filters.BaseRangeFilter(field_name='update_datetime')
    name = django_filters.CharFilter(field_name='name')
    tagsid = django_filters.CharFilter(field_name='tagsid')
    official_account_management_id = django_filters.CharFilter(field_name='official_account_management_id')

    class Meta:
        model = FanTags
        fields = "__all__"


class FanGroupsFilterSet(django_filters.rest_framework.FilterSet):
    create_datetime = django_filters.BaseRangeFilter(field_name='create_datetime')
    update_datetime = django_filters.BaseRangeFilter(field_name='update_datetime')
    name = django_filters.CharFilter(field_name='name')
    groupid = django_filters.CharFilter(field_name='groupid')
    official_account_management_id = django_filters.CharFilter(field_name='official_account_management_id')

    class Meta:
        model = FanGroups
        fields = "__all__"
